package com.example.togethermove.ui.fragment;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.fragment.app.Fragment;



import com.example.togethermove.R;
import com.example.togethermove.base.BaseFragment;
import com.example.togethermove.ui.activity.honor.ApplyPKActivity;
import com.example.togethermove.ui.activity.mine.CollectRecordActivity;
import com.example.togethermove.ui.activity.mine.FriendListActivity;
import com.example.togethermove.ui.activity.mine.InformationListActivity;
import com.example.togethermove.ui.activity.mine.MyCupActivity;
import com.example.togethermove.ui.activity.mine.MyMedalActivity;
import com.example.togethermove.ui.activity.mine.MyOrderActivity;
import com.example.togethermove.ui.activity.mine.PersonHomePageActivity;
import com.example.togethermove.ui.activity.mine.SetEverydaySportActivity;
import com.example.togethermove.ui.activity.mine.SettingActivity;
import com.example.togethermove.ui.activity.togetherMove.SportRecordDetailActivity;


import java.util.List;
import java.util.Timer;

import butterknife.BindView;
import butterknife.ButterKnife;

import butterknife.OnClick;
import butterknife.Unbinder;
import io.reactivex.annotations.Nullable;

/**
 * @ClassName:
 * @Author: csl
 * @Date:
 * @Description: 首页fragment
 */
public class HonorFragment extends BaseFragment {



    @BindView(R.id.ed_honor_search)///搜索
    EditText tvFinish;

    @BindView(R.id.im_honor_pic)// 大图片
    ImageView im_honor_pic;
    @BindView(R.id.im_honor_one) //上面2个小图标
    ImageView im_honor_one;
    @BindView(R.id.im_honor_two)
    ImageView im_honor_two;
    @BindView(R.id.im_left)//左右
    ImageView im_left;
    @BindView(R.id.im_right)
     ImageView im_right;


    private static final String TAG = "AutoViewPager";

    private int currentItem;

    private Timer mTimer;
//    private AutoTask mTask;

    private boolean isFirst = true;
    private List<Fragment> fragmentList;
//    private boolean isFirst = true;
    public static HonorFragment instance;
    Unbinder unbinder;
    public HonorFragment() {
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        View view = inflater.inflate(R.layout.fragment_honor, null);
        unbinder = ButterKnife.bind(this, view);
        instance = this;



        return view;
    }

    @Override
    protected View getSuccessView() {
        return null;
    }

    @Override
    public Object requestData() {
        return null;
    }


    public void start(){
        if (mTimer == null) {
            mTimer = new Timer();
        }
//        mTimer.schedule(new AutoTask(),3000,3000);

    }


    @OnClick({R.id.ed_honor_search, R.id.im_honor_one,
            R.id.im_honor_two, R.id.im_left,R.id.im_right,
          })
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ed_honor_search: //
                toNewActivity(InformationListActivity.class);
                break;
            case R.id.im_honor_one:
                toNewActivity(SettingActivity.class);
                break;
            case R.id.im_honor_two://
                toNewActivity(FriendListActivity.class);
                break;
            case R.id.lin_mine_comment://
                toNewActivity(FriendListActivity.class);
                break;
            case R.id.lin_mine_homepage:
                toNewActivity(PersonHomePageActivity.class);
                break;


        }
    }







//    private Runnable runnable = new Runnable() {
//        @Override
//        public void run() {
////            currentItem = getCurrentItem();
//            if(currentItem == getAdapter().getCount() - 1){
//                currentItem = 0 ;
//            }else {
//                currentItem++ ;
//            }
//            setCurrentItem(currentItem);
//        }
//    };
//    private AutoHandler mHandler = new AutoHandler();
//    private final static class AutoHandler extends android.os.Handler{
//        @Override
//        public void handleMessage(Message msg) {
//            super.handleMessage(msg);
//
//        }
//    }





}











